package com.net.tcpTest;

import java.io.IOException;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;

public class TcpClient {
    public static void main(String[] args) throws IOException {
        InetAddress localHost = InetAddress.getLocalHost();
        System.out.println(localHost.getHostAddress());
        Socket client = new Socket();

        client.connect(new InetSocketAddress(localHost,8189));
        PrintWriter out = new PrintWriter(client.getOutputStream(), true);
        out.println("hello\ndsfs");
        out.println("bye");
    }
}
